#include "rwnx_utils.h"
#include "system.h"

typedef struct {
    uint8_t aic_tkip_conf;
    uint8_t send_bar;
    uint8_t new_backoff_bw_rise_en;
    uint8_t wdt_en;
} wifi_feature_param_t;

typedef struct {
    uint8_t  beacon_linkloss_thd;
    uint8_t  ps_tx_error_max;
    uint16_t bam_inactivity_to_duration;
    uint32_t mm_keep_alive_period;
    uint32_t default_assocrsp_timeout;
    uint32_t default_authrsp_timeout;
    uint32_t scan_active_duration;
    uint32_t scan_passive_duration;
    uint32_t tx_ac0_timeout;
    uint32_t tx_ac1_timeout;
    uint32_t tx_ac2_timeout;
    uint32_t tx_ac3_timeout;
    uint32_t tx_bcn_timeout;
    uint32_t tx_hiq_timeout;
    uint16_t sdio_rx_buf_num_threshold;
    uint16_t sdio_rx_buf_rep_threshold;
    uint16_t deepsleep_notallowed_offset;
    uint16_t ps_activity_to_us;
    uint16_t ps_activity_bcmc_to_us;
    uint16_t ps_activity_uc_to_us;
    uint16_t lp_wakeup_offset;
    uint8_t  tx_he_tb_prog_time;
    uint8_t  tx_agg_finish_dur;
} thresh_param_t;

typedef struct {
    uint8_t host_type;
    uint16_t sdio_desc_cnt;
    uint16_t pkt_cnt_128;
    uint16_t pkt_cnt_1600;
    uint16_t pkt_cnt_1724;
    uint32_t ipc_base_addr;
    uint32_t buf_base_addr;
    uint32_t desc_base_addr;
    uint32_t desc_size;
    uint32_t pkt_base_addr;
    uint32_t pkt_size;
    uint32_t txdesc_cnt[5];
    uint32_t reord_buf_size;
} host_if_param_t;

typedef struct {
    uint32_t rx_ringbuf_start1;
    uint32_t rx_ringbuf_size1;
    uint32_t rx_ringbuf_start2;
    uint32_t rx_ringbuf_size2;
} rx_ringbuf_conf_t;

typedef struct {
    uint32_t ac_param[4];
} ac_param_conf_t;

typedef struct {
    uint8_t fix_txgain_en;
    uint8_t fix_txgain_val;
    uint8_t fix_txgain_val_5g;
    uint8_t fix_1024qam_txgain;
} txgain_conf_t;

typedef struct {
    wifi_feature_param_t wifi_feature_param;
    thresh_param_t thresh_param;
    host_if_param_t host_if_param;
    rx_ringbuf_conf_t rx_ringbuf_conf;
    ac_param_conf_t ac_param_conf;
    uint32_t clkgate_en_config;
    uint32_t uart_config;
    uint8_t lp_level;
    uint8_t bt_use_wifi_rf;
    uint16_t debug_mask;
    txgain_conf_t txgain_config;
    uint16_t pwr_close_sysdelay;
    uint16_t pwr_open_sysdelay;
    uint8_t use_5g;
    uint8_t clkgate_use_hwbcn;
    uint8_t poweroff_use_hwbcn;
    #if (CFG_ROM_VER >= 3)
    //append configuration for u03
    uint8_t fix_txgain_val_24g_11b;
    uint8_t sdio_send_ampdu;
    uint8_t sdio_send_ampdu_blkcnt_thresh;
    #endif
} wifi_settings_t;

#define JUMP_TABLE_BASE_U02     0x00171A30
#define KE_EVT_HDLR_BASE_U02    0x001720C4
#define JUMP_TABLE_BASE_U03     0x00171A3C
#define KE_EVT_HDLR_BASE_U03    0x001720E0
#define SCANU_SCANING_BASE_U03  0x00172438

#define JUMP_TABLE_BASEx(v)     MCAT(JUMP_TABLE_BASE_U0, v)
#define JUMP_TABLE_BASE         JUMP_TABLE_BASEx(CFG_ROM_VER)
#define KE_EVT_HDLR_BASEx(v)    MCAT(KE_EVT_HDLR_BASE_U0, v)
#define KE_EVT_HDLR_BASE        KE_EVT_HDLR_BASEx(CFG_ROM_VER)

#define WIFI_SETTINGS_OFST(mem) (((uint32_t) &((wifi_settings_t *)0)->mem) & ~0x03UL)
#define JUMP_TABLE_OFSTx(i,v)   ((uint32_t)(MCAT(JUMP_TABLE_BASE_U0, v)+(i)*4))
#define JUMP_TABLE_OFST(i)      JUMP_TABLE_OFSTx(i, CFG_ROM_VER)
#define KE_EVT_HDLR_OFSTx(i,v)  ((uint32_t)(MCAT(KE_EVT_HDLR_BASE_U0, v)+(i)*8))
#define KE_EVT_HDLR_OFST(i)     KE_EVT_HDLR_OFSTx(i, CFG_ROM_VER)
#define SCANU_SCANING_OFSTx(i,v)  ((uint32_t)(MCAT(SCANU_SCANING_BASE_U0, v)+(i)*8 + 4))

uint32_t VAR_WITH_VERx(patch_tbl, 2)[][2] =
{
    {WIFI_SETTINGS_OFST(thresh_param.lp_wakeup_offset), 0x080503e8}, // .lp_wakeup_offset = 1000, .tx_he_tb_prog_time = 5, .tx_agg_finish_dur = 8
    {WIFI_SETTINGS_OFST(host_if_param.host_type),       0x00000003}, // .host_type = 3,.sdio_desc_cnt = 0
    {WIFI_SETTINGS_OFST(host_if_param.pkt_cnt_128),     0x00000000}, // .pkt_cnt_128, .pkt_cnt_1600 = 0
    #if PLF_WIFI_AUDIO
    #ifdef CFG_SOFTAP
    {WIFI_SETTINGS_OFST(host_if_param.pkt_cnt_1724),    0x00000011},
    #else
    {WIFI_SETTINGS_OFST(host_if_param.pkt_cnt_1724),    0x00000011},
    #endif
    #else
    {WIFI_SETTINGS_OFST(host_if_param.pkt_cnt_1724),    0x00000011},
    #endif
    {WIFI_SETTINGS_OFST(host_if_param.buf_base_addr),   0x00000000},
    {WIFI_SETTINGS_OFST(host_if_param.desc_base_addr),  0x00000000},
    {WIFI_SETTINGS_OFST(host_if_param.desc_size),       0x00000000},
    {WIFI_SETTINGS_OFST(host_if_param.pkt_size),        0x00007800},
    #if (PLF_BT_STACK || PLF_BLE_STACK) && (PLF_WIFI_STACK)
    {WIFI_SETTINGS_OFST(host_if_param.ipc_base_addr),   0x00190000},
    {WIFI_SETTINGS_OFST(host_if_param.pkt_base_addr),   0x00190800},
    #else
    {WIFI_SETTINGS_OFST(host_if_param.ipc_base_addr),   0x00190000},
    {WIFI_SETTINGS_OFST(host_if_param.pkt_base_addr),   0x00190800},
    #endif
    {WIFI_SETTINGS_OFST(host_if_param.txdesc_cnt[0]),   NX_TXDESC_CNT0},
    {WIFI_SETTINGS_OFST(host_if_param.txdesc_cnt[1]),   NX_TXDESC_CNT1},
    {WIFI_SETTINGS_OFST(host_if_param.txdesc_cnt[2]),   NX_TXDESC_CNT2},
    {WIFI_SETTINGS_OFST(host_if_param.txdesc_cnt[3]),   NX_TXDESC_CNT3},
    {WIFI_SETTINGS_OFST(host_if_param.txdesc_cnt[4]),   NX_TXDESC_CNT4},
    {WIFI_SETTINGS_OFST(host_if_param.reord_buf_size),  NX_REORD_BUF_SIZE},
    {WIFI_SETTINGS_OFST(rx_ringbuf_conf.rx_ringbuf_start1), 0x00000000},
    {WIFI_SETTINGS_OFST(rx_ringbuf_conf.rx_ringbuf_start2), 0x00000000},
    #if FRAMES_11MBPS_ENABLED
    #if defined(CFG_WIFI_VOICE_ROLE_DONGLE)
    {WIFI_SETTINGS_OFST(thresh_param.tx_ac0_timeout),   40000}, // 40ms
    {WIFI_SETTINGS_OFST(thresh_param.tx_ac1_timeout),   40000}, // 40ms
    {WIFI_SETTINGS_OFST(thresh_param.tx_ac2_timeout),   40000}, // 40ms
    {WIFI_SETTINGS_OFST(thresh_param.tx_ac3_timeout),   40000}, // 40ms
    {WIFI_SETTINGS_OFST(ac_param_conf.ac_param[0]),     0x00000a47},
    {WIFI_SETTINGS_OFST(ac_param_conf.ac_param[1]),     0x00000643},
    {WIFI_SETTINGS_OFST(ac_param_conf.ac_param[2]),     0x0005e431},
    {WIFI_SETTINGS_OFST(ac_param_conf.ac_param[3]),     0x0002f321},
    #else
    {WIFI_SETTINGS_OFST(ac_param_conf.ac_param[0]),     0x00000000},
    {WIFI_SETTINGS_OFST(ac_param_conf.ac_param[1]),     0x00000000},
    {WIFI_SETTINGS_OFST(ac_param_conf.ac_param[2]),     0x00000000},
    {WIFI_SETTINGS_OFST(ac_param_conf.ac_param[3]),     0x00000000},
    #endif
    #endif /* FRAMES_11MBPS_ENABLED */
#if CONFIG_SLEEP_LEVEL == 0
    {WIFI_SETTINGS_OFST(lp_level), 0x8d0a0000}, // .lp_level = 0, .bt_use_wifi_rf = 0, .debug_mask=0x8d0a
#elif CONFIG_SLEEP_LEVEL == 1
    {WIFI_SETTINGS_OFST(lp_level), 0xffff0001}, // .lp_level = 1, .bt_use_wifi_rf = 0, .debug_mask=0xffff
#elif CONFIG_SLEEP_LEVEL >= 2
    {WIFI_SETTINGS_OFST(lp_level), 0xffff0002}, // .lp_level = 2, .bt_use_wifi_rf = 0, .debug_mask=0xffff
#endif
    #if PLF_BAND5G
    // Attention, GPIOs used by 5g fem maybe conflict with audio I2SM.
    {WIFI_SETTINGS_OFST(txgain_config.fix_txgain_en),   0xd0e0d003}, // .fix_txgain_en = 3, .fix_txgain_val = 0xd0, .fix_txgain_val_5g = 0xe0, .fix_1024qam_txgain = 0xd0
    {WIFI_SETTINGS_OFST(use_5g),                        0x00010001}, // .use_5g = 1, .clkgate_use_hwbcn = 0, .poweroff_use_hwbcn = 1
    #else
    {WIFI_SETTINGS_OFST(txgain_config.fix_txgain_en),   0xd0e0f301}, // .fix_txgain_en = 1, .fix_txgain_val = 0xf3, .fix_txgain_val_5g = 0xe0, .fix_1024qam_txgain = 0xd0
    #endif
};

uint32_t VAR_WITH_VERx(patch_tbl_func, 2)[][2] =
{
    { JUMP_TABLE_OFSTx( 53, 2), 0x001c6bdd }, //hal_machw_abs_timer_handler_patch
    { JUMP_TABLE_OFSTx( 86, 2), 0x001c610d }, //me_build_associate_req_patch
    { JUMP_TABLE_OFSTx(136, 2), 0x001c6531 }, //phy_get_rf_gain_idx_patch
    { JUMP_TABLE_OFSTx(171, 2), 0x001c6595 }, //rxl_payload_transfer_patch
    { JUMP_TABLE_OFSTx(297, 2), 0x001c66ad }, //phy_rf_add_config_24g_patch
    { JUMP_TABLE_OFSTx(299, 2), 0x001c66bd }, //phy_rf_add_config_5g_patch
    { KE_EVT_HDLR_OFSTx( 0, 2), 0x001c677d }, //rwnxl_reset_evt_patch
    { JUMP_TABLE_OFSTx(106, 2), 0x001c6929 }, //mm_init_patch_patch
    { JUMP_TABLE_OFSTx(154, 2), 0x001c6d15 }, //rc_check_patch_patch
    { JUMP_TABLE_OFSTx( 97, 2), 0x001c6e95 }, //mm_bcn_transmit_patch
    { JUMP_TABLE_OFSTx( 98, 2), 0x001c6fd9 }, //mm_bcn_transmitted_patch
};

uint32_t VAR_WITH_VERx(patch_func, 2)[] =
{
0x4a0f480e,
0x490f6803,
0x03fff023,
0x03c2f043,
0x68136003,
0x03fff023,
0x03c2f043,
0x68036013,
0x237ff423,
0x233ff443,
0x68136003,
0x237ff423,
0x233ff443,
0x601320c2,
0x477071c8,
0x4033b3ac,
0x4033b3d4,
0x001c7174,
0x61647075,
0x20236574,
0x2064253d,
0x0a0d6425,
0x00000000,
0x48254b24,
0xe92d681b,
0x4d2441f0,
0x796a4f24,
0x1007f995,
0x4e23683c,
0x030ff003,
0xb252441a,
0xf06f1a89,
0x4299033d,
0x4619bfb8,
0xfc81fa5f,
0x04fff024,
0x040cea44,
0x6833603c,
0x03fff023,
0x030cea43,
0x683c6033,
0xfa5f1ecb,
0xf424fc83,
0xea44247f,
0x603c340c,
0xf4236833,
0xb24c237f,
0x330cea43,
0x46216033,
0xf66971ec,
0x343df8e5,
0x4b0ddb0e,
0x691a8929,
0xf2474b0c,
0xf1055430,
0xfb04000c,
0xf8d32101,
0xe8bd31e0,
0x471841f0,
0x81f0e8bd,
0x4032011c,
0x001c6048,
0x001c7174,
0x4033b3ac,
0x4033b3d4,
0x40501000,
0x00171a30,
0x4ff0e92d,
0x460db08f,
0x8f3c9f1a,
0x8036f8b7,
0x2c004601,
0xbf084618,
0x46162405,
0xf66b9107,
0xf8b5fda9,
0x9b0790ae,
0x0910f009,
0x0009ea40,
0x0240f107,
0x9202805c,
0xfa1f8018,
0x4614f980,
0xf0002e00,
0x883281d9,
0x8872809a,
0x88b280da,
0x220a811a,
0x98184616,
0x60011899,
0x0c00f04f,
0x007ef895,
0xf8039107,
0x9b07c002,
0x0e02f100,
0x28007058,
0x80bcf040,
0xf8959907,
0xeb0e20b0,
0x23010001,
0xf80e9007,
0x9b073001,
0x46942a08,
0xf04fbf28,
0xf8830c08,
0x9907c001,
0xfe8efa1f,
0x0a02f10c,
0x03b1f105,
0xf10cb152,
0x44ac0cb1,
0x0b01f813,
0x1b52185a,
0xf802459c,
0xd1f70cb0,
0x20b0f895,
0xeb0a44d6,
0x2a080301,
0x93074476,
0x2332d91b,
0x3001f80a,
0xf1a29b07,
0x70590108,
0x0cb1f102,
0x44ac9907,
0x0e06f1a2,
0x03b9f105,
0x0b01f813,
0x1b52185a,
0xf802459c,
0xd1f70cb8,
0x0301eb0e,
0x93074476,
0xf419b2b6,
0xd17d7f80,
0x0f00f1b8,
0x9a02d00b,
0x46104442,
0x0240f1a4,
0x1b01f814,
0x42841bd2,
0xd1f754d1,
0xf8d59b07,
0x444640e0,
0x07e24443,
0x9307b2b6,
0x4ab4d51a,
0xaf0aca07,
0x2000c703,
0x803aa90a,
0x0036f8ad,
0x0032f8cd,
0x0030f88d,
0xa80c1a5b,
0xe00122dd,
0x2f01f811,
0x4288545a,
0x9b07d1fa,
0x33093609,
0x9307b2b6,
0xd50507a7,
0xf8934ba6,
0x07dc3176,
0x80daf100,
0x7d9b4ba4,
0xf0002b01,
0xf8d580e1,
0x071830e0,
0x4a9fd505,
0x2176f892,
0xf1000751,
0x075a80c1,
0x4d9bd51a,
0x3176f895,
0xd515079b,
0xa8074c9a,
0x3150f8d4,
0x44064798,
0xf8d48f28,
0xf66b714c,
0xf895fb8b,
0x2a042175,
0xbf084601,
0xa8072203,
0xb2b647b8,
0xb2864430,
0x681a9b18,
0x1a9b9b07,
0x46309a19,
0xb00f8013,
0x8ff0e8bd,
0x9907307f,
0xf1054428,
0xf813037f,
0x185acb01,
0x42981b52,
0xcc7ef802,
0xe736d1f7,
0x22211c59,
0x701a9107,
0x22029b07,
0x91071c59,
0x701aa80a,
0x0127f10d,
0xff8ef64a,
0x30a4f8d5,
0x2028f99d,
0x3004f993,
0xbfc8429a,
0x3028f88d,
0xf89d9b07,
0x1c592027,
0x701a9107,
0xf89d9b07,
0x1c592028,
0x701a9107,
0x22249b07,
0x91071c59,
0x9b07701a,
0x461a9303,
0x0b01f102,
0x30a4f8d5,
0xb01cf8cd,
0x4a68789b,
0xf0402b00,
0x23018083,
0xa172f892,
0x32769304,
0x0f00f1ba,
0x80bcf000,
0x95062100,
0x46089101,
0x9605468e,
0x460d46a1,
0xf01378d3,
0xd1200302,
0xf8b27894,
0x2c00c000,
0xf6acd173,
0x2c48146c,
0xf640d86a,
0x459c13b4,
0x809ff000,
0xf6ac4c57,
0xfba41367,
0x089c4303,
0x0387f3c3,
0xd0742800,
0x0e0eeba4,
0x45a69c04,
0x3001d173,
0x469eb2c0,
0x31013206,
0x459ab2cb,
0x9b01d8d6,
0xf1039e05,
0x46290e02,
0xf38efa5f,
0x464c9d06,
0xf10b469e,
0x92070201,
0x1000f88b,
0x1c519a07,
0x70109107,
0x36069a03,
0xfa1e7013,
0x9b07f686,
0xe6f5b2b6,
0xa8074b3d,
0x3144f8d3,
0x44064798,
0x30e0f8d5,
0xe734b2b6,
0xa8074b38,
0x3148f8d3,
0x4b354798,
0x44067d9b,
0xb2b62b01,
0xaf1ff47f,
0x30e4f8b5,
0xf43f2b00,
0x9b07af1a,
0x701a2236,
0x22039b07,
0x9b07705a,
0x20e4f8b5,
0xf895805a,
0x711a20e6,
0x36059b07,
0xb2b63305,
0xe7069307,
0xf8922304,
0x9304a173,
0xe77b32ca,
0x4686b9d8,
0x20014605,
0x2c01e7a6,
0xf5acd1f8,
0xf1ac5c9c,
0xb2a4040d,
0x7f4df5b4,
0x4b1dd8f0,
0x0c08f1ac,
0x430cfba3,
0xf3c3089c,
0x28000387,
0x469ed18a,
0x2001461d,
0xf10be78e,
0x94070401,
0x5000f88b,
0x9e019c07,
0x0c01f104,
0x0e02f106,
0xc01cf8cd,
0x0c02f100,
0xfa5f7020,
0x9001f08e,
0xb01cf8dd,
0xfa5f469e,
0xe775f08c,
0x46162204,
0x230ee62b,
0xe765461c,
0x46502302,
0x469e4651,
0xbf00e779,
0x001c70fc,
0x0017a804,
0x0017a984,
0x00171a30,
0xcccccccd,
0xf8934b0c,
0xb953302a,
0xf8934b0b,
0x07c000ac,
0xf893d50e,
0x700b30ad,
0x701323e6,
0x4b064770,
0x00acf893,
0xd5030780,
0x30aef893,
0x7013700b,
0xbf004770,
0x00173164,
0x0017192c,
0x5f6c7872,
0x6c796170,
0x5f64616f,
0x6e617274,
0x72656673,
0x7461705f,
0x00006863,
0x21206470,
0x554e203d,
0x00004c4c,
0x4ff0e92d,
0x68074c3e,
0x881d6824,
0xc000f894,
0xb100f8df,
0xf5b1b083,
0x9e0c6fc8,
0xeb069301,
0xbf280646,
0x61c8f44f,
0x0f03f1bc,
0x4b35bf08,
0xeb079000,
0xf1061606,
0x46900614,
0x601ebf08,
0xe02d2000,
0x0403ebae,
0x440c442c,
0xb2a41b52,
0x2500b291,
0x0f03f1bc,
0xf5b1d10d,
0x460b6f00,
0xf44fbf28,
0xf0436300,
0xf04f4323,
0x60b31204,
0x613160f1,
0x44886172,
0xf8dbb3ac,
0xf8d73000,
0xf9b39004,
0x2b003000,
0x0a14f109,
0xf1bcdb1b,
0xd1010f03,
0xa020f8c6,
0x46564638,
0x4621464f,
0x4302e9d7,
0xfa1f3301,
0xb29bfe84,
0x020eeba3,
0xeb01b292,
0x442c0905,
0xf8c64591,
0x60348004,
0x2400dac0,
0xf1b9e7c6,
0xd1e00f00,
0x480f4b0e,
0x30c4f8d3,
0xf240490e,
0x479812d1,
0x681b4b08,
0xc000f893,
0xf1bce7d3,
0xd1020f03,
0x62344b05,
0x9b00605e,
0x9b01601f,
0xb003801d,
0x8ff0e8bd,
0x00173274,
0x00175aa0,
0x00171a30,
0x001c6588,
0x001c656c,
0x00173250,
0x68134a02,
0x0380f423,
0x47706013,
0x40344014,
0x4382f241,
0xb4104298,
0x4b17d825,
0x601a4a17,
0x4c184917,
0x4818680b,
0xf0234a18,
0x600b6380,
0xf023680b,
0xf043030f,
0x600b0308,
0xf0236823,
0xf04363c0,
0x60236380,
0xf85d6803,
0xf4434b04,
0x60036370,
0xf4236813,
0x60130300,
0xf4436813,
0x60130380,
0xf2414770,
0x42986344,
0xbf944b02,
0x4a084a07,
0xe7d3601a,
0x40344030,
0x7a2a5008,
0x40344038,
0x4034403c,
0x40580108,
0x40344014,
0x791b50c8,
0x7a2ad0c8,
0x786e7772,
0x65725f6c,
0x5f746573,
0x5f747665,
0x63746170,
0x000a0d68,
0x61647075,
0x25206574,
0x25202c64,
0x000a0d64,
0x65736572,
0x6f642074,
0x0a0d656e,
0x00000000,
0x41f0e92d,
0x8310f3ef,
0xd40307db,
0x4b57b672,
0x601a2201,
0x49574c56,
0x4d576823,
0xf44f3301,
0x60236080,
0xfdc8f668,
0x4000f04f,
0xfbc6f667,
0x30ecf8d5,
0x4b514798,
0x68194a51,
0x417ff021,
0x68196019,
0x0110f041,
0x69116019,
0x69133164,
0x2b001acb,
0x4e4bdafb,
0x2410f8d5,
0x4f4a6833,
0x7388f443,
0x0301f043,
0x47906033,
0x68134a43,
0x0310f023,
0x68336013,
0x7388f423,
0x0301f023,
0xf65d6033,
0xf65cfa9d,
0x79bbf801,
0xd04f2b00,
0x681b4b3e,
0x2b03781b,
0x783bd05a,
0xd0472b00,
0x797e4b3b,
0xf997681a,
0xf9973007,
0xf8dfe004,
0x4838c0f8,
0x1000f8dc,
0x81e0f8d5,
0xf0024d30,
0x4416020f,
0x4433b276,
0xbfa84573,
0xfa5f4673,
0xf021fe83,
0xea4101ff,
0xf8cc010e,
0x68021000,
0x02fff022,
0x020eea42,
0xf8dc6002,
0x1eda1000,
0xfe82fa5f,
0x217ff421,
0x310eea41,
0x1000f8cc,
0xf8b76802,
0xf422c008,
0xea42227f,
0x6002320e,
0x4821692a,
0xf64eb25d,
0xfb012160,
0x71fd210c,
0x230047c0,
0x71bb481d,
0x46324629,
0xfcf4f668,
0xf44f491b,
0xf6686080,
0x6823fd3f,
0x4a0bb133,
0x68123b01,
0xb90b6023,
0xb662b102,
0x81f0e8bd,
0x681b4b14,
0x601a2200,
0xfccef64d,
0x2b00783b,
0x79bbd0e6,
0xd19b2b00,
0xbf00e7e2,
0x0017569c,
0x00172600,
0x001c6744,
0x00171a30,
0x40320400,
0x40501000,
0x40340018,
0x001c7174,
0x00173274,
0x4032011c,
0x4033b3d4,
0x001c7180,
0x001c675c,
0x001c676c,
0x00180000,
0x4033b3ac,
0x4d40b570,
0x78ab4c40,
0xf8d4b913,
0x479830e4,
0xfceef65c,
0xff2af65b,
0xfcc0f65b,
0xfa16f665,
0xfb76f663,
0xfbe6f664,
0x338cf8d4,
0x78ab4798,
0x4a374836,
0x4503f240,
0x61452108,
0x2b006151,
0xf65ad058,
0x4d33fc4b,
0x781b682b,
0xd454079e,
0xfe6af65f,
0xfb82f665,
0x47986e63,
0x317cf8d4,
0x4b2d4798,
0x789a482d,
0x4001f993,
0x70192101,
0x70d92114,
0xf3c16801,
0xf0410115,
0x3a147120,
0xb2526001,
0x013df06f,
0xbfb8428a,
0x42a2460a,
0x00c2f04f,
0x682971d8,
0x62184821,
0x4622bfa8,
0x4c20260a,
0xf44f715e,
0x711a757a,
0x811d611c,
0x788b481d,
0x06dc6802,
0xf022bf4c,
0xf0424200,
0x60024200,
0xf0134a19,
0x68130f01,
0xf443bf14,
0xf4232380,
0x60132380,
0x68134a15,
0x6300f043,
0x784b6013,
0xf5a2b12b,
0x68137207,
0x0340f043,
0xbd706013,
0xfbe8f65a,
0x2003e7a5,
0xfffcf64d,
0xbf00e7a6,
0x00173254,
0x00171a30,
0x001804c4,
0x00180484,
0x0017324c,
0x001c7174,
0x403200f0,
0x001c6001,
0x001c605d,
0x40320480,
0x40320310,
0x40320440,
0x6f727265,
0x74203a72,
0x65726568,
0x20736920,
0x6b206f6e,
0x69742065,
0x2072656d,
0x67206e69,
0x74206e65,
0x72656d69,
0x796e6120,
0x65726f6d,
0x00000a0d,
0x6f727265,
0x74203a72,
0x65726568,
0x20736920,
0x6d206f6e,
0x6974206d,
0x2072656d,
0x67206e69,
0x74206e65,
0x72656d69,
0x796e6120,
0x65726f6d,
0x00000a0d,
0x69742821,
0x5f72656d,
0x646e6570,
0x20676e69,
0x41482026,
0x43415f4c,
0x49545f30,
0x5f52454d,
0x29544942,
0x00000000,
0x69742821,
0x5f72656d,
0x646e6570,
0x20676e69,
0x41482026,
0x43415f4c,
0x49545f31,
0x5f52454d,
0x29544942,
0x00000000,
0x69742821,
0x5f72656d,
0x646e6570,
0x20676e69,
0x41482026,
0x43415f4c,
0x49545f32,
0x5f52454d,
0x29544942,
0x00000000,
0x69742821,
0x5f72656d,
0x646e6570,
0x20676e69,
0x41482026,
0x43415f4c,
0x49545f33,
0x5f52454d,
0x29544942,
0x00000000,
0x69742821,
0x5f72656d,
0x646e6570,
0x20676e69,
0x41482026,
0x44495f4c,
0x545f454c,
0x52454d49,
0x5449425f,
0x00000029,
0x69742821,
0x5f72656d,
0x646e6570,
0x20676e69,
0x41482026,
0x45485f4c,
0x5f42545f,
0x454d4954,
0x49425f52,
0x00002954,
0x69742821,
0x5f72656d,
0x646e6570,
0x20676e69,
0x41482026,
0x49485f4c,
0x49545f51,
0x5f52454d,
0x29544942,
0x00000000,
0x4b3c4a3b,
0x6814b510,
0x0561601c,
0x05e2d41d,
0x05a3d416,
0x06e0d410,
0x4b37d431,
0xb122781a,
0x0f2ff014,
0x2201bf1c,
0x4b34719a,
0xf9b3681b,
0x2b003000,
0xbd10db0d,
0xf6684831,
0xe7fefb3d,
0xfad4f65a,
0xd5e605a3,
0x482ee7f6,
0xfb34f668,
0x07e1e7fe,
0x07a2d41c,
0x0763d442,
0x0720d438,
0x0621d42e,
0x0662d424,
0x06a3d41a,
0xe8bdd5e3,
0x49254010,
0xf2404825,
0xf668326e,
0x2004bcc1,
0xf81ef655,
0x4180f04f,
0xf6552004,
0xe7c4f8a7,
0x4010e8bd,
0x481e491c,
0x3265f240,
0xbcb0f668,
0x4010e8bd,
0x481b4918,
0x725bf44f,
0xbca8f668,
0x4010e8bd,
0x48184914,
0x326af240,
0xbca0f668,
0x4010e8bd,
0x48154910,
0x725af44f,
0xbc98f668,
0x4010e8bd,
0x4812490c,
0x3267f240,
0xbc90f668,
0x4010e8bd,
0x480f4908,
0x3266f240,
0xbc88f668,
0x40328084,
0x40328088,
0x001c7174,
0x00173250,
0x001c6a90,
0x001c6a5c,
0x001c710c,
0x001c6bb4,
0x001c6ac4,
0x001c6b8c,
0x001c6b64,
0x001c6b3c,
0x001c6b14,
0x001c6aec,
0x735f6372,
0x3d212073,
0x4c554e20,
0x0000004c,
0x41f0e92d,
0x602cf890,
0xb0822e09,
0xf2004604,
0x4b4f8081,
0x681a4f4f,
0x1386eb06,
0x2000f9b2,
0x03c3eb07,
0xf8d32a00,
0xea4f5148,
0xdb681886,
0xf8956b62,
0xf3c230a1,
0x07595240,
0x2007f88d,
0xf003d45a,
0x682b02fd,
0xf8854943,
0x690a20a1,
0x33c3f503,
0x429333a0,
0x1ad1d862,
0xda042900,
0x43d2493e,
0x428b4413,
0x2100d95e,
0xf6754628,
0xf895fb85,
0x493830a2,
0x22003301,
0x0303f003,
0x30a2f885,
0x209bf885,
0x20a3f885,
0x602a690a,
0xf884009b,
0xb1903046,
0x0107f10d,
0xf6744628,
0xf89dfedb,
0x2b003007,
0xeb08d04c,
0xeb070306,
0xf89303c3,
0xf0422152,
0xf8830211,
0x46282152,
0xf910f675,
0x8de2b1a8,
0x3046f894,
0x1007f89d,
0x5200f442,
0x0303f023,
0xf88485e2,
0xbb613046,
0xeb074446,
0xf89707c6,
0xf0433152,
0xf8870320,
0xb0023152,
0x81f0e8bd,
0xd0a22a00,
0x0202f043,
0x2d00e7a1,
0x4916d194,
0xf2404816,
0xf668329a,
0xe78dfc0d,
0xf8802300,
0xb0023046,
0x81f0e8bd,
0x1a9b4911,
0xd8a0428b,
0x20a2f895,
0x30a3f895,
0x0382ea43,
0x3046f884,
0x6b63e7c1,
0x1320f443,
0xe7cd6363,
0xf4236b63,
0x63631300,
0xbf00e7ad,
0x00173250,
0x00175aa8,
0x40501000,
0x0001869f,
0x001c7130,
0x001c6d04,
0x000186a0,
0x5f6d6d21,
0x5f6e6362,
0x2e766e65,
0x635f7874,
0x00006d66,
0x4ff8e92d,
0x4a414b40,
0x6894681b,
0x3000f9b3,
0x2b004e3f,
0x7a75db41,
0xd14a2d00,
0x72354a3d,
0x017f6817,
0xf8dfb16c,
0xf8df90f8,
0x46aa80f8,
0x0b01f04f,
0x3062f894,
0xd0042b02,
0x2c006824,
0xe8bdd1f8,
0xf8948ff8,
0x2b0030da,
0xf894d0f6,
0x2b003064,
0xf894d0f2,
0xf89420d9,
0x429a30d8,
0xf8d9d1ec,
0x46203170,
0xb1204798,
0x3000f898,
0xf8883301,
0xf1bb3000,
0xd0050f00,
0x0232f1a7,
0x33b6f640,
0xd818429a,
0x4620b9d5,
0xfe6ef662,
0xb9f04683,
0x5000f888,
0x6873e7d0,
0xd0ba2b00,
0x481e491d,
0x727af44f,
0xfb80f668,
0x2d007a75,
0x2301d0b4,
0xe8bd7233,
0x46208ff8,
0xfe56f662,
0xa000f888,
0xf04f6824,
0x25010b00,
0xd1b12c00,
0xf894e7b7,
0xf8843063,
0x23ff3097,
0x3098f884,
0xf1042104,
0xf655006c,
0x6873ff9b,
0x3301b108,
0x2b016073,
0xf04fd002,
0xe79f0b00,
0xfc82f65d,
0x0b00f04f,
0xbf00e79a,
0x00173250,
0x00177720,
0x00178bf8,
0x40328040,
0x001c7140,
0x001c6e80,
0x00171a30,
0x001c71a0,
0x625f6d6d,
0x655f6e63,
0x742e766e,
0x66635f78,
0x0000006d,
0x6d5f6362,
0x000a0d63,
0x43f8e92d,
0x4c3f4b3e,
0x6865681b,
0x3000f9b3,
0x46072b00,
0x3d01db04,
0xb1756065,
0x83f8e8bd,
0xd1f82d00,
0x48394938,
0x4257f240,
0xfb1cf668,
0x3d016865,
0x2d006065,
0x4e35d1f0,
0xfc9af65d,
0xbb4b7833,
0xbb037aa3,
0xb16368e3,
0x80c8f8df,
0xf8d84e30,
0x463051d4,
0xf844f667,
0x47a8300c,
0x2b0068e3,
0xf897d1f5,
0x44040063,
0xb1197d21,
0xf8d34b29,
0x47983190,
0x30dff897,
0xd1cd2b01,
0xe8bd4638,
0xf65b43f8,
0xf8dfbf8b,
0x6820808c,
0x318cf8d8,
0xe7d74798,
0xf6684820,
0x2303f90f,
0x8063f897,
0x210b462a,
0xf666204a,
0xf108fb41,
0xfa5f080a,
0xf880f888,
0x70458000,
0xf6667085,
0x7833fb67,
0xd0bd2b00,
0x1063f897,
0x310a4b14,
0x1181eb01,
0x09c1eb03,
0x3029f899,
0xd50c079b,
0x8034f8df,
0xf8892209,
0xf8d8202a,
0x462a3320,
0x46384649,
0xf8894798,
0x2300502a,
0xe7a17033,
0x00173250,
0x00178bf8,
0x001c7158,
0x001c6fbc,
0x001c71a0,
0x00178c04,
0x00171a30,
0x001c6fd0,
0x00175aa8,
0x500007dd,
0x010002f2,
0x00000000,
0x00000000,
0x5f6c6168,
0x6863616d,
0x62615f77,
0x69745f73,
0x5f72656d,
0x646e6168,
0x5f72656c,
0x63746170,
0x00000068,
0x635f6372,
0x6b636568,
0x7461705f,
0x00006863,
0x625f6d6d,
0x745f6e63,
0x736e6172,
0x5f74696d,
0x63746170,
0x00000068,
0x625f6d6d,
0x745f6e63,
0x736e6172,
0x7474696d,
0x705f6465,
0x68637461,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00,
};

uint32_t VAR_WITH_VERx(patch_tbl, 3)[][2] =
{
    #if PLF_WIFI_AUDIO
    {WIFI_SETTINGS_OFST(thresh_param.beacon_linkloss_thd),         0x00003220}, // .bam_inactivity_to_duration0, .ps_tx_error_max = 50 bcn[0x32], .beacon_linkloss_thd = 32 bcn[0x20]
    {WIFI_SETTINGS_OFST(thresh_param.deepsleep_notallowed_offset), 0x07D02710}, // .deepsleep_notallowed_offset = 10 * 1000[0x2710], .ps_activity_to_us = 2000[0x07D0]
    #else
    {WIFI_SETTINGS_OFST(thresh_param.deepsleep_notallowed_offset), 0x4e202710}, // .deepsleep_notallowed_offset = 10 * 1000[0x2710], .ps_activity_to_us = 20000[0x4e20]
    #endif
    //{WIFI_SETTINGS_OFST(thresh_param.ps_activity_bcmc_to_us), 0x1f400fa0}, // .ps_activity_bcmc_to_us = 4000, .ps_activity_uc_to_us = 8000
    {WIFI_SETTINGS_OFST(thresh_param.lp_wakeup_offset), 0x080503e8}, // .lp_wakeup_offset = 1000, .tx_he_tb_prog_time = 5, .tx_agg_finish_dur = 8
    {WIFI_SETTINGS_OFST(host_if_param.host_type),       0x00000003}, // .host_type = 3,.sdio_desc_cnt = 0
    {WIFI_SETTINGS_OFST(host_if_param.pkt_cnt_128),     0x00000000}, // .pkt_cnt_128, .pkt_cnt_1600 = 0
    #if PLF_WIFI_AUDIO
    #ifdef CFG_SOFTAP
    {WIFI_SETTINGS_OFST(host_if_param.pkt_cnt_1724),    0x00000011},
    #else
    {WIFI_SETTINGS_OFST(host_if_param.pkt_cnt_1724),    0x00000011},
    #endif
    #else
    {WIFI_SETTINGS_OFST(host_if_param.pkt_cnt_1724),    0x00000011},
    #endif
    {WIFI_SETTINGS_OFST(host_if_param.buf_base_addr),   0x00000000},
    {WIFI_SETTINGS_OFST(host_if_param.desc_base_addr),  0x00000000},
    {WIFI_SETTINGS_OFST(host_if_param.desc_size),       0x00000000},
    {WIFI_SETTINGS_OFST(host_if_param.pkt_size),        0x00007800},
    #if (PLF_BT_STACK || PLF_BLE_STACK) && (PLF_WIFI_STACK)
    {WIFI_SETTINGS_OFST(host_if_param.ipc_base_addr),   0x00190000},
    {WIFI_SETTINGS_OFST(host_if_param.pkt_base_addr),   0x00190800},
    #else
    {WIFI_SETTINGS_OFST(host_if_param.ipc_base_addr),   0x00190000},
    {WIFI_SETTINGS_OFST(host_if_param.pkt_base_addr),   0x00190800},
    #endif
    {WIFI_SETTINGS_OFST(host_if_param.txdesc_cnt[0]),   NX_TXDESC_CNT0},
    {WIFI_SETTINGS_OFST(host_if_param.txdesc_cnt[1]),   NX_TXDESC_CNT1},
    {WIFI_SETTINGS_OFST(host_if_param.txdesc_cnt[2]),   NX_TXDESC_CNT2},
    {WIFI_SETTINGS_OFST(host_if_param.txdesc_cnt[3]),   NX_TXDESC_CNT3},
    {WIFI_SETTINGS_OFST(host_if_param.txdesc_cnt[4]),   NX_TXDESC_CNT4},
    {WIFI_SETTINGS_OFST(host_if_param.reord_buf_size),  NX_REORD_BUF_SIZE},
    {WIFI_SETTINGS_OFST(rx_ringbuf_conf.rx_ringbuf_start1), 0x00000000},
    {WIFI_SETTINGS_OFST(rx_ringbuf_conf.rx_ringbuf_size1), (24 * 1024)},
    {WIFI_SETTINGS_OFST(rx_ringbuf_conf.rx_ringbuf_start2), 0x00000000},
    {WIFI_SETTINGS_OFST(rx_ringbuf_conf.rx_ringbuf_size2), (1024 - 12)},
    #if FRAMES_11MBPS_ENABLED
    #if defined(CFG_WIFI_VOICE_ROLE_DONGLE)
    {WIFI_SETTINGS_OFST(thresh_param.tx_ac0_timeout),   20000}, // 20ms
    {WIFI_SETTINGS_OFST(thresh_param.tx_ac1_timeout),   20000}, // 20ms
    {WIFI_SETTINGS_OFST(thresh_param.tx_ac2_timeout),   20000}, // 20ms
    {WIFI_SETTINGS_OFST(thresh_param.tx_ac3_timeout),   20000}, // 20ms
    {WIFI_SETTINGS_OFST(ac_param_conf.ac_param[0]),     0x00000a47},
    {WIFI_SETTINGS_OFST(ac_param_conf.ac_param[1]),     0x00000643},
    {WIFI_SETTINGS_OFST(ac_param_conf.ac_param[2]),     0x0005e431},
    {WIFI_SETTINGS_OFST(ac_param_conf.ac_param[3]),     0x0002f321},
    #else
    {WIFI_SETTINGS_OFST(ac_param_conf.ac_param[0]),     0x00000000},
    {WIFI_SETTINGS_OFST(ac_param_conf.ac_param[1]),     0x00000000},
    {WIFI_SETTINGS_OFST(ac_param_conf.ac_param[2]),     0x00000000},
    {WIFI_SETTINGS_OFST(ac_param_conf.ac_param[3]),     0x00000000},
    #endif
    #endif /* FRAMES_11MBPS_ENABLED */
#if CONFIG_SLEEP_LEVEL == 0
    {WIFI_SETTINGS_OFST(lp_level), 0x8d080000}, // .lp_level = 0, .bt_use_wifi_rf = 0, .debug_mask=0x8d08
#elif CONFIG_SLEEP_LEVEL == 1
    {WIFI_SETTINGS_OFST(lp_level), 0xffff0001}, // .lp_level = 1, .bt_use_wifi_rf = 0, .debug_mask=0xffff
#elif CONFIG_SLEEP_LEVEL >= 2
    {WIFI_SETTINGS_OFST(lp_level), 0xffff0002}, // .lp_level = 2, .bt_use_wifi_rf = 0, .debug_mask=0xffff
#endif
    #if PLF_BAND5G
    // Attention, GPIOs used by 5g fem maybe conflict with audio I2SM.
    {WIFI_SETTINGS_OFST(txgain_config.fix_txgain_en),   0xd0e0d003}, // .fix_txgain_en = 3, .fix_txgain_val = 0xd0, .fix_txgain_val_5g = 0xe0, .fix_1024qam_txgain = 0xd0
    {WIFI_SETTINGS_OFST(use_5g),                        0x00010001}, // .use_5g = 1, .clkgate_use_hwbcn = 0, .poweroff_use_hwbcn = 1
    #else
    {WIFI_SETTINGS_OFST(txgain_config.fix_txgain_en),   0xd0e0f301}, // .fix_txgain_en = 1, .fix_txgain_val = 0xf3, .fix_txgain_val_5g = 0xe0, .fix_1024qam_txgain = 0xd0
    #endif
};

uint32_t VAR_WITH_VERx(patch_tbl_func, 3)[][2] =
{
    { JUMP_TABLE_OFSTx(154, 3), 0x001c6001 }, //rc_check_patch
    { KE_EVT_HDLR_OFSTx( 0, 3), 0x001c6169 }, //rwnxl_reset_evt_patch
    { JUMP_TABLE_OFSTx(295, 3), 0x001c6315 }, //hw_reg_config_before_rf_calib_patch
    { JUMP_TABLE_OFSTx(146, 3), 0x001c6485 }, //ps_check_tx_frame_patch
    { JUMP_TABLE_OFSTx(302, 3), 0x001c65b5 }, //rwnx_sleep_deepsleep_config_patch
    { JUMP_TABLE_OFSTx(196, 3), 0x001c679d }, //sm_delete_resources_patch
    { JUMP_TABLE_OFSTx(256, 3), 0x001c68a9 }, //txl_hwdesc_config_post_patch
    { JUMP_TABLE_OFSTx(281, 3), 0x001c6b21 }, //vif_mgmt_unregister_patch
    { JUMP_TABLE_OFSTx(283, 3), 0x001c6d15 }, //wifi_lp_recover_from_pd_patch
    { JUMP_TABLE_OFSTx(284, 3), 0x001c6e11}, //wifi_lp_timeout_isr_handler_patch
    { JUMP_TABLE_OFSTx(285, 3), 0x001c7001 }, //wifi_main_patch
    { JUMP_TABLE_OFSTx(159, 3), 0x001c7185 }, //rwnxl_sleep_patch
    { JUMP_TABLE_OFSTx(142, 3), 0x001c7259}, // ps_actps_timer_handle_patch
    { JUMP_TABLE_OFSTx(261, 3), 0x001c730d }, // txl_transmit_trigger_patch
    { JUMP_TABLE_OFSTx(279, 3), 0x001c73d1 }, // vif_mgmt_send_postponed_frame_patch
#if FRAMES_11MBPS_ENABLED
    { JUMP_TABLE_OFSTx(106, 3), 0x001c7941 }, //mm_init_patch
#endif
};

uint32_t VAR_WITH_VERx(patch_func, 3)[] =
{0x41f0e92d,
0x602cf890,
0xb0822e09,
0xd87f4604,
0x4f4f4b4e,
0xeb06681a,
0xf9b21386,
0xeb072000,
0x2a0003c3,
0x5148f8d3,
0x1886ea4f,
0x6b62db68,
0x30a1f895,
0x5240f3c2,
0xf88d0759,
0xd45a2007,
0x02fdf003,
0x4943682b,
0x20a1f885,
0xf503690a,
0x33a033c3,
0xd8614293,
0x29001ad1,
0x493eda04,
0x441343d2,
0xd95d428b,
0x46282100,
0xf8e8f677,
0x30a2f895,
0x33014937,
0xf0032200,
0xf8850303,
0xf88530a2,
0xf885209b,
0x690a20a3,
0x009b602a,
0x3046f884,
0xf10db190,
0x46280107,
0xfc3ef676,
0x3007f89d,
0xd04b2b00,
0x0306eb08,
0x03c3eb07,
0x2152f893,
0x0211f042,
0x2152f883,
0xf6764628,
0xb1a8fe73,
0xf8948de2,
0xf89d3046,
0xf4421007,
0xf0235200,
0x85e20303,
0x3046f884,
0x4446bb59,
0x07c6eb07,
0x3152f897,
0x0320f043,
0x3152f887,
0xe8bdb002,
0x2a0081f0,
0xf043d0a2,
0xe7a10202,
0xd1942d00,
0x48164915,
0xf669224e,
0xe78efff7,
0xf8802300,
0xb0023046,
0x81f0e8bd,
0x1a9b4911,
0xd8a1428b,
0x20a2f895,
0x30a3f895,
0x0382ea43,
0x3046f884,
0x6b63e7c2,
0x1320f443,
0xe7ce6363,
0xf4236b63,
0x63631300,
0xbf00e7ae,
0x001732b0,
0x00176020,
0x40501000,
0x0001869f,
0x001c7d90,
0x001c7bac,
0x000186a0,
0x41f0e92d,
0x8310f3ef,
0xd40307db,
0x4b57b672,
0x601a2201,
0x49574c56,
0x4d576823,
0xf44f3301,
0x60236080,
0xfe08f669,
0x4000f04f,
0xfc06f668,
0x30ecf8d5,
0x4b514798,
0x68194a51,
0x417ff021,
0x68196019,
0x0110f041,
0x69116019,
0x69133164,
0x2b001acb,
0x4e4bdafb,
0x2410f8d5,
0x4f4a6833,
0x7388f443,
0x0301f043,
0x47906033,
0x68134a43,
0x0310f023,
0x68336013,
0x7388f423,
0x0301f023,
0xf65e6033,
0xf65dfadb,
0x79bbf847,
0xd04f2b00,
0x681b4b3e,
0x2b03781b,
0x783bd05a,
0xd0472b00,
0x797e4b3b,
0xf997681a,
0xf9973007,
0xf8dfe004,
0x4838c0f8,
0x1000f8dc,
0x81e0f8d5,
0xf0024d30,
0x4416020f,
0x4433b276,
0xbfa84573,
0xfa5f4673,
0xf021fe83,
0xea4101ff,
0xf8cc010e,
0x68021000,
0x02fff022,
0x020eea42,
0xf8dc6002,
0x1eda1000,
0xfe82fa5f,
0x217ff421,
0x310eea41,
0x1000f8cc,
0xf8b76802,
0xf422c008,
0xea42227f,
0x6002320e,
0x4821692a,
0xf64eb25d,
0xfb012160,
0x71fd210c,
0x230047c0,
0x71bb481d,
0x46324629,
0xfd34f669,
0xf44f491b,
0xf6696080,
0x6823fd7f,
0x4a0bb133,
0x68123b01,
0xb90b6023,
0xb662b102,
0x81f0e8bd,
0x681b4b14,
0x601a2200,
0xf826f64e,
0x2b00783b,
0x79bbd0e6,
0xd19b2b00,
0xbf00e7e2,
0x00175bfc,
0x00172618,
0x001c7bbc,
0x00171a3c,
0x40320400,
0x40501000,
0x40340018,
0x0017325c,
0x001732d4,
0x4032011c,
0x4033b3d4,
0x00173268,
0x001c7bd4,
0x001c7be4,
0x00180000,
0x4033b3ac,
0x4d52b470,
0x682b4852,
0x4a534c52,
0x4e544953,
0x63c0f423,
0x7300f443,
0x6803602b,
0x03bcf423,
0x5370f423,
0x2360f443,
0x6380f443,
0x68236003,
0x0360f023,
0x68136023,
0x33fef423,
0x3398f443,
0x680b6013,
0x63c0f023,
0x7300f043,
0x69ab600b,
0x50fff5a0,
0xf0433814,
0x61ab6380,
0xf4436803,
0x60036300,
0xf4236a23,
0xf043737f,
0x62230304,
0xf5a26803,
0xf5a2120f,
0xf42352fe,
0x3a1c5380,
0x6300f443,
0x68136003,
0x41daf501,
0x03ccf023,
0xf043316c,
0x601303c4,
0xf003680b,
0xf5a5437f,
0xf44355f7,
0x3d141378,
0x7378f443,
0x682b600b,
0xf5a40c1b,
0x041b5400,
0xf0433c14,
0x602b0384,
0x4d286823,
0x6340f423,
0x6300f443,
0xf8d06023,
0xf5023104,
0xf42352f8,
0x321823e0,
0x3380f443,
0x3104f8c0,
0xf0236813,
0xf0235376,
0xf5010307,
0xf04351f7,
0x31045304,
0x0307f043,
0x680b6013,
0x5400f504,
0x52eff102,
0x5001f500,
0xf502341c,
0x401d223d,
0x0244f602,
0x600d4b13,
0x60323008,
0x68036023,
0xf4234a11,
0xf423237f,
0xf4436300,
0x60033332,
0xf44368cb,
0x60cb6300,
0xf0236813,
0xf4430309,
0xbc705380,
0x47706013,
0x40344020,
0x40344024,
0x40344028,
0x40580104,
0x4033b3b8,
0x4034402c,
0xff000003,
0x1a2e5108,
0x40580108,
0x43f8e92d,
0x78234c3c,
0xd05e2b00,
0xd05c28ff,
0xd05a29ff,
0x4f3a4b39,
0x1080eb00,
0x00c0eb03,
0x65a4f44f,
0xfb057f86,
0xf8957506,
0x2a002062,
0xf895d14b,
0x2b003064,
0xf8dfd047,
0x4b3190ec,
0x2000f8d9,
0x8ed1691b,
0x80e0f8df,
0x22036165,
0x77624419,
0x31e0f8d8,
0x000cf104,
0x4b2a4798,
0x075b681b,
0x4b29d531,
0x30b6f893,
0xd12f2b00,
0x681b4b27,
0x2b02781b,
0x4a23d12f,
0x68134925,
0x0304f023,
0x784b6013,
0x77222201,
0x4a22b123,
0xf0236813,
0x60134300,
0xb10b7a23,
0x72233b01,
0x2000f8d9,
0x8ed14b17,
0xf8d8691a,
0x616531e0,
0x77602004,
0x48194411,
0xf44f4798,
0xfb0363a4,
0x685a7306,
0x7280f442,
0x2000605a,
0x83f8e8bd,
0x681b4b0f,
0x2a02781a,
0xf8d8d003,
0x47983254,
0x480fe7f3,
0x6802490f,
0x7200f422,
0x680a6002,
0x0201f022,
0xe7bd600a,
0x001792b4,
0x00176020,
0x00177cb0,
0x40501000,
0x4032004c,
0x00171934,
0x001732d0,
0x001732c4,
0x40320434,
0x001792c0,
0x4033b390,
0x4032008c,
0x001732a4,
0x00171a3c,
0xf0002800,
0xe92d80a9,
0xf89043f0,
0xb0833064,
0xb9134604,
0xe8bdb003,
0x4b5f83f0,
0xf8df4a5f,
0xf8d2c1bc,
0x4e5ee470,
0x4f5f4a5e,
0x91b0f8df,
0x81b0f8df,
0xf8c32002,
0xf8dc0180,
0xf8ccc008,
0xf04fe044,
0x60180c01,
0xc000f886,
0x6813693f,
0xf0236077,
0x460d0302,
0x60134954,
0xf8d9680f,
0xf8b83000,
0x8f9b10b2,
0x017f9100,
0x4950463a,
0xfbbcf669,
0x68134a4f,
0x030ff003,
0xd06c2b0b,
0x3000f8d9,
0x20b2f8b8,
0x44138f9b,
0xd2c142bb,
0x49496872,
0xf6692002,
0x4a43fba9,
0x691268f3,
0x2b001a9b,
0xf8b4da5e,
0x4b442068,
0xf8936869,
0x2a050d23,
0x3a01d95f,
0x7702fb01,
0x3d23f893,
0x463a493f,
0xf6692002,
0xf8d9fb91,
0xf8b82000,
0x8f9230b2,
0x48344933,
0x69044d3a,
0x680b441a,
0xf0221aba,
0xf0030003,
0x43030303,
0x600b4836,
0x60b26803,
0x0301f043,
0x682b6003,
0xf3c36829,
0xf4210309,
0xf043717f,
0xf0210301,
0x430b0103,
0x6803602b,
0x075b4422,
0xd50360f2,
0xf44f4b2b,
0x601a7200,
0x482b4c2a,
0x491e6823,
0xf0434a1e,
0x60230308,
0xf0436803,
0x60030302,
0xf043680b,
0x600b0301,
0xf5016911,
0x69137196,
0x2b001a5b,
0xb003dbfb,
0x83f0e8bd,
0x68134770,
0x030ff023,
0xe7956013,
0x491c4b15,
0x3d23f893,
0x2002463a,
0xfb3cf669,
0xf893e7a9,
0x2a012d24,
0xf893d99e,
0xb12a2d23,
0x2d23f893,
0xfb013a01,
0xe7957702,
0x2d24f893,
0xbf00e78f,
0xe000e100,
0x00171a3c,
0x001732b4,
0x40320084,
0x40501000,
0x40328040,
0x001c7bf4,
0x4058001c,
0x001c7c04,
0x001e4000,
0x001c7c20,
0x40506000,
0x40044084,
0x40044100,
0x40580010,
0x40580018,
0x001c7c0c,
0xe000ed00,
0x001732a4,
0x00171934,
0x41f0e92d,
0x46042302,
0x21052206,
0x4019f241,
0xfce2f667,
0x23022206,
0x21054606,
0x4017f241,
0xfcdaf667,
0x80e0f8df,
0x46054933,
0x7080f44f,
0xfae8f669,
0xfdf8f66d,
0xf6554620,
0x2700fea5,
0x006cf894,
0x3024f8d8,
0x70374798,
0x3063f894,
0x482a7073,
0x010cf1a6,
0xf954f668,
0x3064f894,
0xf894bb7b,
0x2bff306c,
0x2301d00d,
0x22062100,
0xf667200c,
0x4601fcb1,
0x306cf894,
0x390cf801,
0xf668481e,
0x6c23f93f,
0x2301b16b,
0x22062100,
0xf6672039,
0x4601fca1,
0x3063f894,
0x390cf801,
0xf6684816,
0x2300f92f,
0xf894702b,
0x706b3063,
0x010cf1a5,
0xf6684811,
0xe8bdf925,
0xf66d41f0,
0x2206bf03,
0x46392304,
0xf667201e,
0x7087fc85,
0x3063f894,
0xf1a070c3,
0x4808010c,
0xf912f668,
0x31d8f8d8,
0x47984806,
0x775f4b06,
0xf4236863,
0x60637380,
0xbf00e7b5,
0x001c7c30,
0x0017af08,
0x001792c0,
0x001792b4,
0x00171a3c,
0x43f0e92d,
0x6cc56b43,
0x1800f413,
0x4604b083,
0x0728f105,
0xf403d008,
0xf5b31360,
0xf0001f20,
0xb003808f,
0x83f0e8bd,
0x6d068dc3,
0xd538071a,
0x9240f8df,
0x2000f8d9,
0x2000f9b2,
0xf2c02a00,
0x6a7180c3,
0x6a32b909,
0x06186891,
0xf894d509,
0x2b003043,
0x80d1f040,
0x3045f894,
0xf0402b00,
0x6cf380d3,
0x03f0f423,
0x790b64f3,
0xf01363b7,
0xbf080f01,
0x7800f44f,
0xf8c62300,
0x65338048,
0x6e2a6aeb,
0xf0436372,
0x62eb0302,
0xf65a4620,
0x6ce2fd4b,
0xf0436a53,
0x62530310,
0xe8bdb003,
0x4b6e83f0,
0x3428f8d3,
0x6deb4798,
0xf89464b3,
0x496b202b,
0x60a4f44f,
0x1202fb00,
0x2062f892,
0xf894bb32,
0x4967202c,
0x1282eb02,
0x02c2eb01,
0x2124f8d2,
0xd51b0692,
0xf4128de2,
0x6be25f00,
0xbf146bd2,
0x1200f3c2,
0x02c0f3c2,
0xf8d6b982,
0xf8bcc024,
0x04102000,
0xd509b291,
0x200ae9d6,
0x010ef3c1,
0x3a043804,
0x1000f8ac,
0x200ae9c6,
0x8160f8df,
0xf8d863b7,
0x6d272000,
0x2000f9b2,
0xdb472a00,
0xb90a6a7a,
0x68926a3a,
0x63c0f423,
0x791264b3,
0xbf5c07d2,
0x7300f443,
0xe79f64b3,
0x6c866b83,
0x22c2f3c3,
0x63372a05,
0xf403d10d,
0x6cea63c0,
0x6f80f5b3,
0xf44fbf14,
0xf44f3380,
0xf4223300,
0x431a3240,
0xf10464ea,
0xf6580038,
0xf8d4ff01,
0x6ba2c04c,
0xf8dc88b0,
0x6de93024,
0x6aea63ea,
0x0408f040,
0xf44180b4,
0x6e2c60c0,
0xf04262f4,
0x64300202,
0x0310f043,
0x463962ea,
0x7082f506,
0xf8cc2234,
0xb0033024,
0x43f0e8bd,
0xb8a6f678,
0x2a006ce2,
0x6a7ad03c,
0xd1b52a00,
0xb1926a3a,
0xe7b06cb3,
0x6a71b32d,
0xf47f2900,
0x6a32af3c,
0x8de3b10a,
0x4923e736,
0xf2404823,
0xf66912b9,
0x6a32fb37,
0x491fe7f5,
0xf240481f,
0xf66912b9,
0x6a3afb2f,
0x2220e7e4,
0x91014620,
0xff70f672,
0xe72c9901,
0x91018922,
0xf6744620,
0x9901f889,
0x4914e725,
0xf44f4815,
0xf66972d9,
0x6a71fb19,
0xf8d9b9a9,
0xf9b33000,
0x2b003000,
0xe7d8dbcf,
0x72d9f44f,
0x480d490b,
0xfb0af669,
0xb9426a7a,
0x3000f8d8,
0x3000f9b3,
0xdbb72b00,
0x8de3e7d1,
0x6cb3e6f9,
0xbf00e768,
0x00171a3c,
0x00177cb0,
0x00176020,
0x001c7d78,
0x001c7c64,
0x001c7c44,
0x001732b0,
0x43f8e92d,
0x4d6f4604,
0xf44f486f,
0xfb0666a4,
0x19aff604,
0xf6684639,
0x4b6cf803,
0x42ba6a1a,
0x2200bf04,
0xf44f621a,
0xfb0363a4,
0xf8935304,
0x2b023062,
0x809ef000,
0xd0722b04,
0x91a0f8df,
0x81a8f8df,
0xd0632b00,
0x3012f899,
0x2011f899,
0x2b014413,
0x495ed114,
0x0008f8d9,
0xc190f8df,
0x2300e9d1,
0x0310f023,
0x431a604b,
0x4b5a4959,
0x2000f8cc,
0xc038f8d0,
0xf8c18f82,
0x601ac000,
0x0018f106,
0x31d8f8d8,
0x47984428,
0x0028f106,
0x31d8f8d8,
0x47984428,
0x63a4f44f,
0x5304fb03,
0x24c0f893,
0xf44fbb4a,
0xfb0363a4,
0xf8935304,
0xf6650063,
0x4b49fdd1,
0x42ba691a,
0x2200bf04,
0x2100611a,
0x62a4f44f,
0xf6494638,
0xf44ffadf,
0xfb0060a4,
0xf8d85404,
0x62e33450,
0x237f2205,
0x63274639,
0x2062f884,
0x3065f884,
0x3066f884,
0xe8bd483b,
0xf66743f8,
0xf893bf43,
0x210104c1,
0xf80ef665,
0x3013f899,
0xf8893b01,
0xe7ca3013,
0x2011f899,
0x3012f899,
0xb2d23a01,
0x2011f889,
0xf64ae796,
0x2800fa6f,
0xf8dfd137,
0xf8df90b4,
0xf89980bc,
0xf44f0010,
0xfb0363a4,
0x685a5300,
0xf0226c19,
0x605a0280,
0xf8d8b111,
0x47983054,
0x3012f899,
0x481eb9e3,
0x68424922,
0xc090f8df,
0x430a6001,
0x2000f8cc,
0xf89921ff,
0xf8892011,
0xe76d1010,
0x9068f8df,
0x3012f899,
0xb2db3b01,
0x3012f889,
0xf899b1cb,
0xf8df2011,
0xe75f8060,
0xf93af65e,
0x3012f899,
0x2000e7e6,
0xfa3cf64a,
0x681a4b11,
0xd5c005d2,
0x7280f44f,
0x2080f8c3,
0x8f4ff3bf,
0x8f6ff3bf,
0xf65ee7b7,
0xf8dff94b,
0xe741802c,
0x00177cb0,
0x00177ca0,
0x001792b4,
0x00179130,
0x40320020,
0x40320024,
0x00175f48,
0x00177c98,
0x3503858c,
0xe000e100,
0x00171a3c,
0x40320060,
0x41f0e92d,
0xf8df4d35,
0xf8d580f0,
0xf89834d0,
0x4e337d22,
0xf8d84798,
0xf64941bc,
0xf8d5fc9b,
0x4798349c,
0xf8d5492f,
0x680b2488,
0x7300f423,
0x7920600b,
0x79234790,
0x302af886,
0xf8867962,
0x7b62202b,
0x202cf886,
0x892088e1,
0x85328962,
0x84b1b2ff,
0xb9cb84f0,
0x34a0f8d5,
0x8cf04798,
0x34a4f8d5,
0xf9944798,
0xf8d5000c,
0x4798333c,
0xf8d5491d,
0xf5a134d4,
0x479860a4,
0x0f0df017,
0xf8d5d00c,
0xe8bd3254,
0x471841f0,
0x34a8f8d5,
0x8cf04798,
0x34acf8d5,
0xe7e44798,
0xd51a07bb,
0x31dff898,
0xf8d54a11,
0x491141e0,
0xf44f4811,
0xfb0565a4,
0x61432303,
0xf042685a,
0x605a0202,
0x23056909,
0xf5017743,
0x4623511c,
0xe8bd300c,
0x311041f0,
0xe8bd4718,
0xbf0081f0,
0x00171a3c,
0x00173198,
0x4033b390,
0x001e469c,
0x00177cb0,
0x40501000,
0x001792b4,
0x001e4000,
0x47f0e92d,
0x4a674b66,
0x6a14681e,
0x0601f016,
0x80e8f8d4,
0xf000b084,
0x681a8093,
0xf0224f62,
0x601a0201,
0x707b2300,
0x0901f04f,
0x4a60495f,
0x4d60680b,
0x0310f043,
0x6813600b,
0xf023495e,
0x60130301,
0x3078f894,
0x3301680a,
0xf884b2db,
0x78123078,
0xf0c0429a,
0x4b58808c,
0x681b4a58,
0x92006912,
0x464a4957,
0xf6682002,
0x783bff91,
0xd0472b00,
0x313cf8d5,
0x9040f8d4,
0x47982000,
0x681b4b51,
0x3000f9b3,
0xdb672b00,
0x3480f8d5,
0x0004f899,
0xa154f8df,
0xf04f4798,
0xf8b90c00,
0xf8992006,
0xf8b91005,
0xf8993008,
0xf8cd0004,
0xf899c008,
0xf8cdc00d,
0xf8b9c004,
0xf8cdc00a,
0xf64ac000,
0xf999f885,
0xf8d5000c,
0x4798333c,
0x349cf8d5,
0xf8d54798,
0x464134d8,
0x47984620,
0x302af89a,
0xd02e2b00,
0x34a8f8d5,
0x0026f8ba,
0xf8ba4798,
0xf8d50026,
0x479834ac,
0xe9c72300,
0x703b3301,
0xd03c2e00,
0x68134a30,
0x0301f023,
0x492f6013,
0x680b4a2f,
0x48304c2f,
0x7300f423,
0x6813600b,
0x03fff023,
0x0310f043,
0x68a36013,
0x22a0f8d5,
0x2320655a,
0xb0046003,
0x87f0e8bd,
0x46b14f19,
0xf8d5e772,
0xf8ba34a0,
0x47980026,
0x0026f8ba,
0x34a4f8d5,
0xe7cf4798,
0x3018f899,
0xd1932bff,
0x481f491e,
0x4246f240,
0xf8bef669,
0xf894e78c,
0xf8d5006c,
0x46221164,
0xfd16f656,
0x4620e76b,
0xfcb0f65c,
0x4a176863,
0x0301f043,
0xf8926063,
0x2b0030b6,
0xf655d0bb,
0xe7b8fca1,
0x40580010,
0x001792b4,
0x001732b4,
0x40328094,
0x40044084,
0x00171a3c,
0x001732a4,
0x40320088,
0x40501000,
0x001c7c78,
0x001732b0,
0x4032008c,
0x4033b390,
0x40320078,
0xe000ed00,
0xe000e100,
0x001c7da0,
0x001c7c94,
0x00171934,
0x00173198,
0x47f0e92d,
0x4e354c34,
0x60344d35,
0x8100f8df,
0x4a354834,
0x4b364935,
0xf8df4f36,
0x1d2690f8,
0xf104602e,
0xf8c80544,
0xf1045000,
0x60050580,
0xf1044e31,
0x60100090,
0x02aaf104,
0x00a8f104,
0x6008601a,
0x3230f8d6,
0x683d4798,
0x050ff005,
0x030af1a5,
0xbf8c2b01,
0x23012300,
0x3002f889,
0xfda4f669,
0xff70f64d,
0x3274f8d6,
0xf8944798,
0x48221044,
0xf668462a,
0xf64efe43,
0xf64dfdb3,
0xf899ffc1,
0xb3133002,
0x346cf8d6,
0x4a1c4798,
0xf0236813,
0x60130308,
0xf003683b,
0x2b0a030f,
0x4918d010,
0xf6682002,
0xf8d8fe7b,
0x781b3000,
0xd1022b03,
0x22014b14,
0xf8d6601a,
0xe8bd3280,
0x471847f0,
0xf023683b,
0x603b030f,
0x490fe7e9,
0xf6682002,
0xe7e8fe65,
0x00171934,
0x001732ac,
0x001732a4,
0x001732a8,
0x00173288,
0x001732d0,
0x001732b0,
0x4058001c,
0x00171a3c,
0x001c7cb4,
0x40580010,
0x001c7cc8,
0x40044100,
0x001c7cd4,
0x001732d4,
0x001732b4,
0x4c15b530,
0x7f234915,
0x2002b083,
0x68639300,
0xf6687822,
0x7823fe39,
0x4b11b93b,
0x31f8f8d3,
0xb9104798,
0xb0032000,
0x6863bd30,
0xd1f92b00,
0x689c4b0c,
0x4d0cb164,
0x6824e001,
0x6862b144,
0x20024629,
0xfe20f668,
0x2b006863,
0xe7e9d0f5,
0xb0032001,
0xbf00bd30,
0x001792b4,
0x001c7ce0,
0x00171a3c,
0x00177c98,
0x001c7cf4,
0x4c2cb510,
0x781b6823,
0xb17bb082,
0x68124a2a,
0x020ff002,
0xd10b2a0b,
0xd1052b01,
0xf8d34b27,
0x479834b4,
0x781b6823,
0xd01e2b02,
0xbd10b002,
0xffb0f7ff,
0xd02e2800,
0xf8d34b21,
0x2a0021f8,
0x4b20d132,
0x68194820,
0x3024f890,
0x6140f3c1,
0x7f414319,
0xb9a1d014,
0xf8d34b18,
0x479830f4,
0xd0e32800,
0x781b6823,
0x4a17e7d6,
0x6a104b13,
0x34b8f8d3,
0x10e8f8d0,
0xe8bdb002,
0x47184010,
0xfab24613,
0x9100f282,
0x49100952,
0xf6682002,
0xb002fdc5,
0x490ebd10,
0x42e4f240,
0xb0022002,
0x4010e8bd,
0xbdbaf668,
0xf8914907,
0x7f493024,
0xbf00e7e7,
0x001732d0,
0x4058001c,
0x00171a3c,
0x00175ce0,
0x4032004c,
0x001792b4,
0x001c7d08,
0x001c7d00,
0x4b24b570,
0x681b4d24,
0x781b4a24,
0x21f8f8d2,
0x686b2b01,
0xf0034604,
0xd01a0320,
0xbf0c4313,
0x20002001,
0x3064f894,
0xb1a0b1ab,
0x681a4b1c,
0xd5200192,
0x2b057f6b,
0x6863d103,
0x0302f023,
0x4b186063,
0x776a2200,
0x3250f8d3,
0x4070e8bd,
0x43134718,
0x4b14d017,
0x68194a14,
0x8ec94b11,
0x2001616c,
0x69127768,
0x31e0f8d3,
0xe8bd4810,
0x44114070,
0x681b4718,
0xd4ec019b,
0x3024f895,
0xd0e82b00,
0xf64fe7d6,
0x3800fd53,
0x2001bf18,
0xbf00e7c8,
0x001732d4,
0x001792b4,
0x00175ce0,
0x4032004c,
0x00171a3c,
0x001732a4,
0x40501000,
0x001792c0,
0xb5704b26,
0x04e2681c,
0x4d25d437,
0xd123422c,
0x40214924,
0x0323d027,
0x4b23d418,
0xf9b3681b,
0xfab13000,
0xf1c1f181,
0x2b000419,
0xdb2bb2e4,
0xd00b2c05,
0x1da14a1d,
0x408b2301,
0x4b1c6013,
0xf8d34620,
0xe8bd33a0,
0x47184070,
0xf44f4b17,
0x601a2200,
0xe7f22405,
0xfb90f659,
0x4b134911,
0x601d4021,
0x4813d1d7,
0xfcc4f668,
0xf8d24a12,
0x3b0131f8,
0x31f8f8c2,
0xf659bd70,
0x4b0bfad3,
0x5280f44f,
0xe7c0601a,
0xd9d12c06,
0x480c490b,
0x62b0f44f,
0xfeacf668,
0xbf00e7cc,
0x40328078,
0x20000800,
0x000807c0,
0x001732b0,
0x4032807c,
0x00171a3c,
0x001c7d18,
0x00175ce0,
0x001c7dc4,
0x001c7d24,
0xf8d0b570,
0xb15440e8,
0x46054e05,
0xf8d64621,
0x22053320,
0x47984628,
0x2c006824,
0xbd70d1f6,
0x00171a3c,
0xb4704b11,
0xf5034606,
0xe0066400,
0x8832895d,
0xd00b4295,
0x42a33340,
0x7a1ad013,
0x0008f103,
0xd1f32a00,
0xd0f52900,
0x4770bc70,
0x8872899d,
0xd1ef4295,
0x88b289dd,
0xd0f54295,
0x42a33340,
0x2000d1eb,
0x4770bc70,
0x0017af38,
0x4ff0e92d,
0xed2d4d5d,
0x682f8b02,
0xf897b087,
0x9300314a,
0x20044604,
0xf930f667,
0xd0052801,
0xb0072000,
0x8b02ecbd,
0x8ff0e8bd,
0x462b8ba1,
0x7a1a2600,
0x1886ea4f,
0xd1762a00,
0x380cf895,
0xf14007db,
0xf1088089,
0x442b0308,
0x0908eb05,
0x8be28059,
0x8c22809a,
0xf89480da,
0xf894202d,
0xea43302c,
0xf8a92302,
0x8de33038,
0xf83a46a2,
0xf8a92b30,
0xf003303a,
0xf1c30301,
0xf1a20302,
0x46500124,
0x0216f10d,
0x3032f8a9,
0x1a10ee08,
0xfcf8f667,
0xf0002800,
0xf89d8175,
0xf8892016,
0xf1082010,
0x44290111,
0x460bb152,
0x0c02f1c3,
0x18c24411,
0x200cf812,
0x2b01f803,
0xd1f84299,
0x3833f895,
0xf0402b00,
0xf8958188,
0x2b00380a,
0xf897d15c,
0xf1bcc14c,
0xd0570f00,
0x0111f108,
0xeb054699,
0xee080308,
0x4429aa90,
0x469a46bb,
0xf109e007,
0x45cc0901,
0x0b21f10b,
0xf3404662,
0xf89b8189,
0x280000fc,
0xf89ad03a,
0x42822010,
0xf10bd1ef,
0x910100fd,
0xfaf6f677,
0xf0002800,
0xf89781b2,
0x9901c14c,
0x895ae7e3,
0xf000428a,
0x3601811e,
0xf1032e20,
0xf47f0340,
0x4620af7a,
0x220b2304,
0x0104f241,
0xfe64f666,
0xb0072001,
0x8b02ecbd,
0x8ff0e8bd,
0x380cf8b5,
0xf47f428b,
0x8be2af5f,
0x380ef8b5,
0xf47f429a,
0x8c22af59,
0x3810f8b5,
0xf47f429a,
0xe764af53,
0x0017af38,
0xaa90ee18,
0x45914662,
0xaf4af43f,
0x1a10ee18,
0xf6674650,
0x2800fd67,
0x80f7f000,
0x788379a2,
0xf0002a00,
0x2a018106,
0x8122f040,
0x29a41e59,
0x811ef200,
0x0383eb03,
0x519cf503,
0x46103108,
0xff58f66a,
0xeb053601,
0xeb050308,
0x63581286,
0x3009f994,
0x1004f992,
0xda004299,
0x01b67113,
0x0208eb05,
0x63d32300,
0xf89551ab,
0x2b00380a,
0x80b2f000,
0x8e514613,
0x0f0af853,
0xb2f4f8df,
0x9b00889a,
0xf44f4eb8,
0xfb0767a4,
0xeb0bf703,
0xf8560307,
0xf8a36008,
0x22ff216c,
0x1190f8a3,
0x0168f8c3,
0x2165f883,
0x21c2f883,
0x619cf8c3,
0x316ef893,
0xf1079701,
0x44d909f0,
0xf0402b00,
0x9b0080c2,
0x67a4f44f,
0x0e08eb05,
0xb703fb07,
0x0c10f10e,
0x77b7f507,
0x0e30f10e,
0xce0f4666,
0x60384576,
0x60ba6079,
0x46b460fb,
0x0710f107,
0x7833d1f4,
0x9900703b,
0xeb059a01,
0xf44f0308,
0xfb0767a4,
0xee18b701,
0x93021a10,
0xf8c76b5b,
0xf5023194,
0x230072d0,
0x445ab28e,
0x31c6f8a7,
0x31d0f8c7,
0x46504631,
0xf6699203,
0x9b02fdb5,
0x6b5b9a03,
0x2b00789b,
0x809df000,
0xf5039b01,
0x445a72d8,
0x0317f10d,
0x46504631,
0xff4cf669,
0x9a00b180,
0x63a4f44f,
0xb302fb03,
0x119ef8b3,
0x21d0f8d3,
0x7100f441,
0x0201f042,
0x119ef8a3,
0x21d0f8c3,
0xf8934b7d,
0x07df3176,
0x9a00d509,
0x63a4f44f,
0xb302fb03,
0x21d0f8d3,
0xf10007d0,
0x21008084,
0x4638460f,
0xf66b464a,
0x464afac3,
0x46504631,
0xfdbef669,
0x4631464a,
0xf6694650,
0x464afdc3,
0x46504631,
0xfe26f669,
0xf44f9a00,
0xfb0363a4,
0x2101b302,
0x21d0f8d3,
0x1834f885,
0x4200f042,
0x21d0f8c3,
0x0308eb05,
0xb9137a1b,
0x330188ab,
0x444580ab,
0x722b2301,
0x8998e6e7,
0x42908be2,
0xaeddf47f,
0x8c2289d8,
0xf47f4290,
0xe65baed8,
0x0010f889,
0x3601e69a,
0x1786eb05,
0x2009f994,
0x3004f997,
0xf77f429a,
0x88a1af20,
0xf66a79a0,
0xeb05fe67,
0x63580308,
0x713b7a63,
0x1e59e715,
0xd81b290d,
0xd0612b0e,
0x0383eb03,
0x1167f603,
0x9b01e6fb,
0x106ff203,
0xf6774458,
0x2800fbb7,
0xaf35f43f,
0xf108e74d,
0x49440011,
0x22074428,
0xf990f677,
0xf47f2800,
0xe6cdae19,
0x71fff64f,
0x4610e6e3,
0xf66a2101,
0xf010ffe7,
0xbf1a000f,
0xf080fab0,
0x031ff1c0,
0xf8872301,
0xe75331c5,
0xaa90ee18,
0x464ae6b5,
0x46504631,
0xf6699302,
0x9b02fef3,
0xf43f2800,
0xf8d3af72,
0xf04221d0,
0xf8c30202,
0xee1821d0,
0x46501a10,
0xfd36f667,
0xf8934b29,
0x07512176,
0xd41f4607,
0xd40a0792,
0xf44f9a00,
0xfb0363a4,
0xf8d3b302,
0xf01111d0,
0xf43f0108,
0x9b01af56,
0x7288f503,
0x4631445a,
0xf6694650,
0xb9b8feed,
0xe74a4601,
0x11b4f640,
0xee18e69b,
0xf897aa90,
0xe67a214c,
0xf5039b01,
0x445a728e,
0x46504631,
0xfef8f669,
0xb9a89b02,
0xf8934b11,
0xe7d12176,
0xf44f9a00,
0xfb0363a4,
0xee18b302,
0xf8d31a10,
0xf04221d0,
0x46500204,
0x21d0f8c3,
0xfd12f667,
0xe7224601,
0x11d0f8d3,
0x0008f041,
0x01d0f8c3,
0x4631464a,
0xf6694650,
0xe7ddff2b,
0x0017af70,
0x0017ad7c,
0x001c7d48,
0x00177cb0,
0xf7ff4608,
0xbf00bd81,
0x4d34b538,
0x78ab4c34,
0xf8d4b913,
0x479830e4,
0xfa1ef65c,
0xfc5af65b,
0xf9f2f65b,
0xff34f664,
0xf894f663,
0xf904f664,
0x338cf8d4,
0x4a2b4798,
0x78a94b2b,
0x4503f240,
0x61552004,
0x62f6f24f,
0x220be9c3,
0x2209e9c3,
0x29006158,
0xf65ad03a,
0x4d24f907,
0x781b682b,
0xd436079b,
0xfb70f65f,
0xf89af665,
0x47986e63,
0x317cf8d4,
0xf64d4798,
0x4a1dfaf9,
0x6813481d,
0x0315f3c3,
0x7320f043,
0x682a6013,
0x78936801,
0xbf4c06dc,
0x4100f021,
0x4100f041,
0x49166001,
0x0f01f013,
0xbf14680b,
0x2380f443,
0x2380f423,
0x4912600b,
0xf043680b,
0x600b6300,
0xb1237853,
0x68134a0f,
0x0340f043,
0xbd386013,
0xf8c2f65a,
0x2003e7c3,
0xf856f64d,
0xbf00e7c4,
0x001732b4,
0x00171a3c,
0x001804c4,
0x00180484,
0x001732ac,
0x403200f0,
0x40320480,
0x40320310,
0x40320440,
0x40320224,
0x49046cc3,
0x60986a5a,
0x0210f022,
0x60d9625a,
0xbf004770,
0xcafefade,
0xe92d6b43,
0x029d47f0,
0x804cf8d0,
0x460f4606,
0xd52f4691,
0x1360f403,
0x1f20f5b3,
0x4c47d02a,
0x9020f888,
0x3380f8d4,
0x46304639,
0x68f34798,
0xd50707da,
0xf6488bb1,
0x22016388,
0xf8864299,
0xd06d2054,
0x8df36cf1,
0xd50407db,
0x3047f896,
0xf8863301,
0x6a4b3047,
0x60ca4a39,
0x0310f023,
0x4630624b,
0x3404f8d4,
0x463a608e,
0x20004798,
0x87f0e8bd,
0xa03cf8d6,
0x0424f108,
0x0040f10a,
0xf8534653,
0xf8445b04,
0x42835f04,
0x8df3d1f9,
0xd5c4049c,
0xf896492b,
0x4a2b302c,
0xeb036809,
0xeb021383,
0xf9b103c3,
0xf8d32000,
0x2a004148,
0x4641db2c,
0x2014f8da,
0x309cf8d4,
0x2040f8c8,
0x2024f8da,
0x2050f8c8,
0x22c2f3c3,
0xf8c82a05,
0xd10f303c,
0x204cf8d8,
0x63c0f403,
0x6f80f5b3,
0xf44fbf14,
0xf44f3080,
0xf4223000,
0x43033340,
0x304cf8c8,
0x303cf8da,
0xbf5e0758,
0x302cf8d8,
0x73c0f423,
0x302cf8c8,
0xe7884688,
0xd1d02c00,
0x480f490e,
0x729bf44f,
0xfac6f668,
0xe7c96cf1,
0x480c6d33,
0xf6686ada,
0x6cf1f8c1,
0xf4236b8b,
0xf443437f,
0x638b6360,
0xbf00e785,
0x00171a3c,
0xcafefade,
0x001732b0,
0x00176020,
0x001c7d64,
0x001c7bac,
0x001c7d50,
0x735f6372,
0x3d212073,
0x4c554e20,
0x0000004c,
0x786e7772,
0x65725f6c,
0x5f746573,
0x5f747665,
0x63746170,
0x000a0d68,
0x61647075,
0x25206574,
0x25202c64,
0x000a0d64,
0x65736572,
0x6f642074,
0x0a0d656e,
0x00000000,
0x20676663,
0x25206425,
0x64252064,
0x00000a0d,
0x78253d74,
0x00000a0d,
0x20746f6e,
0x74736170,
0x6425203a,
0x0d64252c,
0x0000000a,
0x73736170,
0x6425203a,
0x0d64252c,
0x0000000a,
0x656c6564,
0x72206574,
0x72756f65,
0x0d736563,
0x0000000a,
0x5f6c7874,
0x66667562,
0x675f7265,
0x74287465,
0x73656478,
0x21202963,
0x554e203d,
0x00004c4c,
0x2d646874,
0x7269663e,
0x705f7473,
0x705f6462,
0x00007274,
0x2520706c,
0x61202c64,
0x6c737463,
0x64253a70,
0x6974202c,
0x253d656d,
0x000a0d78,
0x74787463,
0x64693e2d,
0x3d212078,
0x41484320,
0x54435f4e,
0x555f5458,
0x4553554e,
0x00000044,
0x74736f68,
0x65707974,
0x2c64253d,
0x0d782520,
0x0000000a,
0x656b6177,
0x0d217075,
0x0000000a,
0x69666977,
0x6e69616d,
0x000a0d21,
0x6f5f7370,
0x6425206e,
0x20642520,
0x0a0d6425,
0x00000000,
0x20666976,
0x78252050,
0x00000a0d,
0x25204353,
0x000a0d64,
0x204d4353,
0x25206425,
0x64252064,
0x00000a0d,
0x69207854,
0x25207273,
0x000a0d78,
0x65636361,
0x635f7373,
0x67657461,
0x2079726f,
0x4e28203c,
0x58545f58,
0x4e435f51,
0x29322b54,
0x00000000,
0x45524944,
0x002d5443,
0x206c7874,
0x2c78253a,
0x6e656c20,
0x0d64253d,
0x0000000a,
0x675f6372,
0x735f7465,
0x735f6174,
0x73746174,
0x00000000,
0x5f6c7874,
0x66667562,
0x6d5f7265,
0x64686361,
0x65675f72,
0x00000074,
0x635f6372,
0x6b636568,
0x7461705f,
0x00006863,
0x69666977,
0x5f706c5f,
0x656d6974,
0x5f74756f,
0x5f727369,
0x646e6168,
0x5f72656c,
0x63746170,
0x00000068,
0x5f6c7874,
0x6e617274,
0x74696d73,
0x6972745f,
0x72656767,
0x7461705f,
0x006863,
};

#define AON_PATCH_START_ADDR_U02    0x001E4D28
#define AON_PATCH_NUM_U02           0x001E4D2C
#define PATCH_STORE_ADDR_U02        0x001E6000
#define FW_PATCH_ADDR_U02           0x001C6000
#define AON_PATCH_START_ADDR_U03    0x001E4D28
#define AON_PATCH_NUM_U03           0x001E4D2C
#define PATCH_STORE_ADDR_U03        0x001E6000
#define FW_PATCH_ADDR_U03           0x001C6000

#define AON_PATCH_START_ADDRx(v)    MCAT(AON_PATCH_START_ADDR_U0, v)
#define AON_PATCH_START_ADDR        AON_PATCH_START_ADDRx(CFG_ROM_VER)
#define AON_PATCH_NUMx(v)           MCAT(AON_PATCH_NUM_U0, v)
#define AON_PATCH_NUM               AON_PATCH_NUMx(CFG_ROM_VER)
#define PATCH_STORE_ADDRx(v)        MCAT(PATCH_STORE_ADDR_U0, v)
#define PATCH_STORE_ADDR            PATCH_STORE_ADDRx(CFG_ROM_VER)
#define FW_PATCH_ADDRx(v)           MCAT(FW_PATCH_ADDR_U0, v)
#define FW_PATCH_ADDR               FW_PATCH_ADDRx(CFG_ROM_VER)

patch_tbl_array_t patch_tbl;
patch_tbl_array_t patch_tbl_func;
uint32_t *patch_func;
uint32_t patch_tbl_size;
uint32_t patch_tbl_func_size;
uint32_t patch_func_size;
uint32_t aon_patch_start_addr;
uint32_t aon_patch_num;
uint32_t patch_store_addr;
uint32_t fw_patch_addr;

void wifi_patch_prepare(void)
{
    #if (CFG_ROM_VER == 255)
    uint8_t chip_id = ChipIdGet(0);
    if (chip_id == 0x03) {
        patch_tbl               = VAR_WITH_VERx(patch_tbl, 2);
        patch_tbl_func          = VAR_WITH_VERx(patch_tbl_func, 2);
        patch_func              = VAR_WITH_VERx(patch_func, 2);
        patch_tbl_size          = sizeof(VAR_WITH_VERx(patch_tbl, 2)) / 4;
        patch_tbl_func_size     = sizeof(VAR_WITH_VERx(patch_tbl_func, 2)) / 4;
        patch_func_size         = sizeof(VAR_WITH_VERx(patch_func, 2)) / 4;
        aon_patch_start_addr    = AON_PATCH_START_ADDRx(2);
        aon_patch_num           = AON_PATCH_NUMx(2);
        patch_store_addr        = PATCH_STORE_ADDRx(2);
        fw_patch_addr           = FW_PATCH_ADDRx(2);
    } else if (chip_id == 0x07) {
        patch_tbl               = VAR_WITH_VERx(patch_tbl, 3);
        patch_tbl_func          = VAR_WITH_VERx(patch_tbl_func, 3);
        patch_func              = VAR_WITH_VERx(patch_func, 3);
        patch_tbl_size          = sizeof(VAR_WITH_VERx(patch_tbl, 3)) / 4;
        patch_tbl_func_size     = sizeof(VAR_WITH_VERx(patch_tbl_func, 3)) / 4;
        patch_func_size         = sizeof(VAR_WITH_VERx(patch_func, 3)) / 4;
        aon_patch_start_addr    = AON_PATCH_START_ADDRx(3);
        aon_patch_num           = AON_PATCH_NUMx(3);
        patch_store_addr        = PATCH_STORE_ADDRx(3);
        fw_patch_addr           = FW_PATCH_ADDRx(3);
    }
    #else
    patch_tbl               = VAR_WITH_VER(patch_tbl);
    patch_tbl_func          = VAR_WITH_VER(patch_tbl_func);
    patch_func              = VAR_WITH_VER(patch_func);
    patch_tbl_size          = sizeof(VAR_WITH_VER(patch_tbl)) / 4;
    patch_tbl_func_size     = sizeof(VAR_WITH_VER(patch_tbl_func)) / 4;
    patch_func_size         = sizeof(VAR_WITH_VER(patch_func)) / 4;
    aon_patch_start_addr    = AON_PATCH_START_ADDR;
    aon_patch_num           = AON_PATCH_NUM;
    patch_store_addr        = PATCH_STORE_ADDR;
    fw_patch_addr           = FW_PATCH_ADDR;
    #endif
}
